{% extends "student/layout.html" %}

{% set page_title = __('账号设置') %}

{% block content %}
<div class="m-scontent">
<form class="form-horizontal" method="POST" id="{{ form.__class__.__name__ }}">
    {{ form.hidden_tag() }}
    <fieldset class="fieldset">
		<legend>{{__('用户名')}}：{{ current_user.school.code }}.{{ form.username.data }}<a href="/student/change-password" style="color:#999;margin-left:60%;font-size:14px;">{{__('修改密码')}}</a></legend>

        {% from "common/_formhelper.html" import render_field %}
        {{ render_field(form.name, placeholder=__('姓名'), class_="form-control", required=True) }}

        {% from "common/_formhelper.html" import render_radio %}
        {{ render_radio(form.gender) }}

        {{ render_field(form.day_of_birth, placeholder="yyyy-mm-dd", class_="form-control", required=True) }}

        {{ render_field(form.parent_name, class_="form-control", required=True) }}

        {% from "common/_formhelper.html" import render_email_field %}
        {{ render_email_field(form.parent_email, class_="form-control", required=True) }}
        <div>
            <button class="btn btn-primary">{{__('保存')}}</button>
        </div>
    </fieldset>

    <fieldset class="fieldset field-bind">
        <div class="erweima">
            <div class="qr_title">{{__('扫描二维码推送成绩')}}</div>
			<iframe id="qr_code" src="{{ url_for('student.bind_qr_code') }}" scrolling="no"></iframe>
        </div>
    </fieldset>
</form>
</div>
{% endblock %}

{% block css %}
<style type="text/css">
#qr_code{width:145px;height:145px;overflow:hidden;border:none;}
.qr_title{text-align:center}
</style>
{% endblock %}

{% block js %}
<script type="text/javascript">
	$(function(){
        $('input:checkbox').bind('click',function(){
            var checked=$(this).prop('checked');
            if(checked){
                $('input[type="password"]').attr('readonly','readonly');
            }
            else{
                $('input[type="password"]').removeAttr('readonly');
            }
        });

	});
</script>
{% endblock %}
